{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X = [\n",
    "    [1, 2, 3, 2],\n",
    "    [7, 8, 9, 2.01],\n",
    "    [4, 8, 2, 2.01],\n",
    "    [9, 5, 2, 1.99],\n",
    "    [7, 5, 3, 1.99],\n",
    "    [1, 4, 9, 2]\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "StandardScaler(copy=True, with_mean=True, with_std=True)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss = StandardScaler(with_mean=True, with_std=True)\n",
    "ss.fit(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 4.83333333  5.33333333  4.66666667  2.        ]\n",
      "6\n",
      "[ 3.07769755  2.13437475  3.09120617  0.00816497]\n"
     ]
    }
   ],
   "source": [
    "print ss.mean_\n",
    "print ss.n_samples_seen_\n",
    "print ss.scale_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-1.24551983 -1.56173762 -0.53916387  0.        ]\n",
      " [ 0.70398947  1.2493901   1.40182605  1.22474487]\n",
      " [-0.27076518  1.2493901  -0.86266219  1.22474487]\n",
      " [ 1.3538259  -0.15617376 -0.86266219 -1.22474487]\n",
      " [ 0.70398947 -0.15617376 -0.53916387 -1.22474487]\n",
      " [-1.24551983 -0.62469505  1.40182605  0.        ]]\n"
     ]
    }
   ],
   "source": [
    "print ss.transform(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
